import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class BlindboxActivityProductsVo {
  List<BlindboxActivityProductItem>? data;
  BlindboxActivityProductMeta? meta;

  BlindboxActivityProductsVo({this.data, this.meta});

  BlindboxActivityProductsVo.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = <BlindboxActivityProductItem>[];
      json['data'].forEach((v) {
        data!.add(new BlindboxActivityProductItem.fromJson(v));
      });
    }
    meta = json['meta'] != null ? new BlindboxActivityProductMeta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.meta != null) {
      data['meta'] = this.meta!.toJson();
    }
    return data;
  }
}

class BlindboxActivityProductItem {
  int? id;
  String? title;
  String? price;
  String? thumbnail;
  List<String>? images;
  int? status;
  String? rewardRules;
  String? description;
  int? quantity;
  int? sales;
  String? startTime;
  String? endTime;
  int? remainingTime;

  BlindboxActivityProductItem(
      {this.id,
      this.title,
      this.price,
      this.thumbnail,
      this.images,
      this.status,
      this.rewardRules,
      this.description,
      this.quantity,
      this.sales,
      this.startTime,
      this.endTime,
      this.remainingTime});

  BlindboxActivityProductItem.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    title = json['title'];
    price = json['price'];
    thumbnail = json['thumbnail'];
    images = json['images'].cast<String>();
    status = json['status'];
    rewardRules = json['reward_rules'];
    description = json['description'];
    quantity = json['quantity'];
    sales = json['sales'];
    startTime = json['start_time'];
    endTime = json['end_time'];
    remainingTime = json['remaining_time'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['title'] = this.title;
    data['price'] = this.price;
    data['thumbnail'] = this.thumbnail;
    data['images'] = this.images;
    data['status'] = this.status;
    data['reward_rules'] = this.rewardRules;
    data['description'] = this.description;
    data['quantity'] = this.quantity;
    data['sales'] = this.sales;
    data['start_time'] = this.startTime;
    data['end_time'] = this.endTime;
    data['remaining_time'] = this.remainingTime;
    return data;
  }
}

class BlindboxActivityProductMeta {
  CommonPagination? pagination;

  BlindboxActivityProductMeta({this.pagination});

  BlindboxActivityProductMeta.fromJson(Map<String, dynamic> json) {
    pagination = json['pagination'] != null
        ? new CommonPagination.fromJson(json['pagination'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
    return data;
  }
}